package com.jiexinyun.controller.android;

import com.jiexinyun.dto.request.androidwork.AndroidLoginReq;
import com.jiexinyun.dto.request.androidwork.AndroidLogoutReq;
import com.jiexinyun.dto.response.AjaxResult;
import com.jiexinyun.service.android.PublicWorkService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;

@Slf4j
@RestController
@RequestMapping("/public/work")
@Tag(name = "安卓工作机公开接口", description = "安卓工作机公开接口")
@Valid
public class PublicWorkController {

    @Autowired
    private PublicWorkService service;

    @PostMapping("/login")
    @Operation(summary = "登录接口", description = "登录接口")
    public AjaxResult login(@Valid @RequestBody AndroidLoginReq req) {

        return service.login(req);
    }

    @PostMapping("/logout")
    @Operation(summary = "登出接口", description = "登出接口")
    public AjaxResult logout(@Valid @RequestBody AndroidLogoutReq req) {

        return service.logout(req);
    }

}
